package com.funtester.seven.day2;

public class Student extends People implements State {

    public String school;

    public Teacher teacher;

    public boolean state;

    public Student() {
    }

    public Student(String name, int age, String school, Teacher teacher, boolean state) {
        super(name, age);
        this.school = school;
        this.teacher = teacher;
        this.state = state;
    }

    @Override
    public void sayHi() {
        System.out.println("我是" + school + "," + teacher.name + "老师的学生:" + name);
    }

    public void answer(Teacher teacher) {
        System.out.println(name + "说:" + teacher.name + "老师,我不知道");
    }

    @Override
    public void state() {
        if (state) {
            System.out.println(this.name + "学生,正在上课");
        } else {
            System.out.println(this.name + "学生,没在上课");
        }
    }

}
